feat: Phase 4 API routes (validate, export, history, cancel, delete)#7
Merged
feat: Phase 4 API routes (validate, export, history, cancel, delete)#7
Conversation
Add detailed plan for validate, export stub, run history, cancel, and delete endpoints. Update plan READMEs to reflect Phase 3 merged and Phase 4 in progress. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Upgrade list_runs_by_graph with offset/total/status filter. Add list_runs for cross-graph queries. Add delete_run. Add migration 003 with composite indexes for run history queries. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
POST /v1/graphs/{id}/validate checks schema without executing.
Returns 200 with valid:true or 422 with error details and node refs.
GET /v1/graphs/{id}/export returns 501 until Phase 5.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
GET /v1/graphs/{id}/runs lists paginated runs with status filter.
GET /v1/runs lists all runs for the authenticated owner.
POST /v1/runs/{id}/cancel stops running/paused runs.
DELETE /v1/runs/{id} removes completed/error runs.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add 11 manual test scripts (19-29) covering Phase 4 API routes: validate, export stub, run history, pagination, status filter, cancel paused, cancel stale, delete completed, delete active rejected, and full lifecycle. Fix cancel_run to also set resume_event, unblocking _wait_for_resume so cancellation is detected during pause. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
POST /v1/graphs/{id}/validatechecks schema without executing. Returns 200 withvalid:trueor 422 with error details and node refs. Uses FakeListChatModel to avoid requiring LLM API keys during validation.GET /v1/graphs/{id}/exportreturns 501 until Phase 5 implements code generation.GET /v1/graphs/{id}/runsandGET /v1/runswith pagination (limit/offset),Literalstatus filter, and owner isolation.POST /v1/runs/{id}/cancelreturns 202. Handles both live runs (via RunManager) and stale DB runs (server restart recovery).DELETE /v1/runs/{id}returns 204. Rejects active runs with 409.cancel_run()now also setsresume_event, fixing a hang when cancelling paused runs.Test plan
Unit tests (240 total, all passing)
Manual tests (19-29, all passing)
Notable findings during testing
cancel_run()only setcancel_eventbut notresume_event, causing paused runs to hang on cancel — fixed by setting bothContent-Type: application/jsondue to middleware enforcement — tests sendjson={}🤖 Generated with Claude Code